Skip to content

Require turbo for forked workers only when running from a phar - #6263

Merged
ondrejmirtes merged 1 commit into
2.2.xfrom
fork-parallel-without-turbo
Aug 24, 2026
Merged

Require turbo for forked workers only when running from a phar#6263
ondrejmirtes merged 1 commit into
2.2.xfrom
fork-parallel-without-turbo

Conversation

@ondrejmirtes

Copy link
Copy Markdown
Member

The turbo requirement in ForkParallelChecker exists for the phar-fork-guard — libphar serves phar:// reads through one shared per-archive fd whose seek cursor forked children race on. Outside a phar there is nothing to guard, so the check now demands the active extension only under Phar::running().

Nothing is lost by forking without turbo either: the distributed binaries only exist next to a phar, so spawned workers of a source checkout run without turbo too — and an ini-loaded extension is inherited by fork like any other extension.

Net effect: source-checkout installs — including phpstan-src's own self-analysis in CI and locally — fork their workers and skip the per-worker application re-boot. phpstan diagnose on this checkout (turbo not loaded) now reports Mechanism: fork (pcntl_fork); self-analysis and the full test suite are green through the fork path.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GnwgpaeUXRkgSDyg95tfK8

The turbo requirement existed for the phar-fork-guard: libphar serves
phar:// reads through one shared per-archive fd whose seek cursor forked
children race on. Outside a phar there is nothing to guard - and no
turbo is lost by forking either, because the distributed binaries only
exist next to a phar, so spawned workers of a source checkout run
without turbo too, while an ini-loaded extension is inherited by fork
like any other.

Source-checkout installs - including phpstan-src's own self-analysis -
now fork their workers and skip the per-worker application re-boot.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GnwgpaeUXRkgSDyg95tfK8
@ondrejmirtes
ondrejmirtes merged commit 92fd7d0 into 2.2.x Aug 24, 2026
411 of 413 checks passed
@ondrejmirtes
ondrejmirtes deleted the fork-parallel-without-turbo branch August 24, 2026 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant